/**
 * 文件上传相关API接口
 * @author 王勇程 <laughskydragon@qq.com>
 */

import request from '@/utils/request'

// 上传图片
export function uploadImage(filePath, formData = {}) {
  return uni.$u.http.upload('/upload/uploadImage', {
    filePath,
    name: 'file',
    formData
  })
}

// 上传文件
export function uploadFile(filePath, formData = {}) {
  return uni.$u.http.upload('/upload/uploadFile', {
    filePath,
    name: 'file',
    formData
  })
}

// 删除文件
export function deleteFile(data) {
  return request({
    url: '/upload/deleteFile',
    method: 'post',
    data
  })
}
